package com.colin.project.service;

import com.colin.project.bean.User;
import com.colin.project.util.response.ResponseResult;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpSession;

public interface UserService {
    /**
     * 校验用户名
     * @param username 用户输入的用户名
     * @return 'null' / 具体用户名
     */
    ResponseResult<String> checkUsername(String username);

    /**
     * 发送邮件
     * @param email 目标邮箱
     * @return success / error
     */
    ResponseResult<String> sendEmail(String email,Integer flag);

    /**
     * 校验验证码
     * @param code 验证码
     * @param email 邮箱
     * @return success / error
     */
    ResponseResult<String> checkCode(String code, String email);

    /**
     * 注册逻辑
     * @param user 用于注册的用户数据
     * @return true / false
     */
    Boolean doRegister(User user);

    Boolean changePassword(String email, String password);

    User doLogin(String username, String password);

    ResponseResult<String> headImgUpload(MultipartFile multipartFile, HttpSession session, String md5);

    ResponseResult<String> updatePersonalInfo(User user, HttpSession session);

    ResponseResult<String> videoUpload(MultipartFile multipartFile, HttpSession session, String md5);
}
